home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Controls
/
Visual Basic Controls.iso
/
vbcontrol
/
keyservh
/
examples.ctl
< prev
next >
Wrap
Text File
|
1999-08-19
|
2KB
|
71 lines
VERSION 5.00
Begin VB.UserControl ExampleService
ClientHeight = 1935
ClientLeft = 0
ClientTop = 0
ClientWidth = 2475
ScaleHeight = 1935
ScaleWidth = 2475
Begin VB.Timer BeepTimer
Enabled = 0 'False
Interval = 5000
Left = 240
Top = 480
End
End
Attribute VB_Name = "ExampleService"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
'****************************************************************************************************
' Copyright (c) Key Technology Pty Ltd 1999, All Rights Reserved.
' Web site: http://www.keytech.com.au Email: info@keytech.com.au
'****************************************************************************************************
Option Explicit
'
' This is an example service that beeps periodically.
'
' Must implement IService to be hosted as a service
Implements IService
Private Sub BeepTimer_Timer()
Beep
' Message boxes may be displayed if the service is configured
' to interact with the desktop. Displaying message boxes is not
' recommended as it blocks the service.
MsgBox "The service is blocked until this message box is dismissed.", _
vbSystemModal, "Example Service"
End Sub
Private Property Get IService_Pausable() As Boolean
IService_Pausable = True
End Property
Private Sub IService_OnStart()
BeepTimer.Enabled = True
End Sub
Private Sub IService_OnStop()
BeepTimer.Enabled = False
End Sub
Private Sub IService_OnPause()
BeepTimer.Enabled = False
End Sub
Private Sub IService_OnContinue()
BeepTimer.Enabled = True
End Sub
Private Sub IService_OnControl(ByVal OpCode As Long)
End Sub
Private Sub IService_OnShutdown()
BeepTimer.Enabled = False
End Sub